//
//  YYMusicPeopleCollectionViewCell.swift
//  STMusic
//
//  Created by stoneobs on 2017/6/15.
//  Copyright © 2017年 stoneobs. All rights reserved.
// //**********************音乐人cell***************************

import UIKit

class YYMusicPeopleCollectionViewCell: UICollectionViewCell {
    
    var model:YYMusicPeopleModel = YYMusicPeopleModel(){
    
        didSet{
        
            self.imageView?.sd_setImage(with: URL.init(string: model.pimg!), placeholderImage: PeopleImage, options: .retryFailed);
            
            self.nickNameLable?.text = model.nickname;
        }
    }
    var imageView:UIImageView?
    
    var nickNameLable:STLabel?
    
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        initSubview()
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    func initSubview() {
        
        self.backgroundColor = UIColor.white.withAlphaComponent(0.7);
        
        let itemWith = SCREEN_WIDTH / 3;
        
        self.imageView = UIImageView.init(frame: .init(x: 0, y: 10, width: 60, height: 60));
        
        self.imageView?.centerX = itemWith / 2;
        
        self.addSubview(self.imageView!);
        
        self.nickNameLable = STLabel.init(frame: .init(x: 0, y: 5 + (self.imageView?.bottom)!, width: itemWith, height: 13),
                                          text: "古风岭",
                                          textColor: FirstTextColor,
                                          font: 13,
                                          isSizetoFit: false,
                                          textAlignment: .center);
        
        self.addSubview(self.nickNameLable!);
    }
    
}
